package hu.elte.tudaskezelo.dbpedialike.views;

import hu.elte.tudaskezelo.dbpedialike.R;
import hu.elte.tudaskezelo.dbpedialike.domain.CityInformation;
import roboguice.inject.InjectView;
import android.view.View;
import android.widget.TextView;

import com.google.inject.Singleton;

@Singleton
public class CityInformationView {

	@InjectView(R.id.textView1)
	TextView cityName;
	//@InjectView(R.id.textView2)
	//TextView cityPopulation;
	@InjectView(R.id.textView4)
	TextView cityHistory;
	 
	
	@InjectView(R.layout.info)
	View holder;
	
	View getCityInformationView(CityInformation cityInformation){
		cityName.setText(cityInformation.getName());
		//cityPopulation.setText("Population: " + cityInformation.getPopulation());
		cityHistory.setText(cityInformation.getHistory());

//		try {
//			ImageView i = (ImageView) findViewById(R.id.cityImage);
//			Bitmap bitmap = BitmapFactory.decodeStream((InputStream) new URL(
//					cityInformation.getPhotoURL()).getContent());
//			i.setImageBitmap(bitmap);
//		} catch (MalformedURLException e) {
//			Log.e("Exception", "MalformedURLException");
//		} catch (IOException e) {
//			Log.e("Exception", "IOException");
//		}

		
		
		return holder;
		
	}
	
	
	
}
